project_path=$(cd `dirname $0`; pwd)

echo $project_path

echo "net.ipv6.conf.all.disable_ipv6 =1" >/etc/sysctl.conf
sysctl -p
sysctl -w net.ipv6.conf.all.disable_ipv6=1
echo "precedence ::ffff:0:0/96 100" >>/etc/gai.conf

curl -L -s https://install.direct/go.sh -o go.sh
bash go.sh


rm -f /usr/bin/chport
rm -f /etc/v2ray/config.json.temp

HOSTIP=`ifconfig | awk '/inet / { print $2 }'|grep -v 127.0.0.1`


cp $project_path/config.json   /etc/v2ray/config.json.temp
cp $project_path/chport   /usr/bin/chport

chmod +x /usr/bin/chport 

systemctl  enable v2ray

chport 555
